package com;

import com.spring.config.BeanConfiguration;
import com.spring.entity.Area;
import com.spring.service.AccountService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = BeanConfiguration.class)
public class test {
    @Autowired
    private AccountService bean;
    @Test
    public void testFind(){
        //获取容器
        List<Area> areas = bean.queryArea();
        System.out.println(areas.size());
        System.out.println(areas);
    }
}
